import Vue from 'vue'
import VueRouter from 'vue-router'
import layout from '@/views/layout'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: layout,
    // 重定向
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        component: () => import('@/views/dashboard')
      },
      {
        // 关于我们
        path: 'aboutus',
        component: () => import('@/views/aboutus')
      },
      {
        // 分类
        path: 'classify',
        component: () => import('@/views/classify')
      },
      {
        // 经纪
        path: 'manage',
        component: () => import('@/views/manage')
      },
      // 地产详情
      {
        path: 'details/:id',
        component: () => import('@/views/details')
      },
      {
        // 地产列表
        path: 'landlist',
        component: () => import('@/views/landlist')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
